package com.example.mworks;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LoginActivity extends Activity {

	EditText login, senha;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		/*Intent intent = new Intent();
		intent.setClass(this, CategoriasActivity.class);
		startActivity(intent);
		finish();*/
		setContentView(R.layout.login_activity);
		
		login = (EditText) findViewById(R.campo.cLogin);
		senha = (EditText) findViewById(R.campo.cSenha);
		
		Button logar = (Button) findViewById(R.botao.logar);
		logar.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				String l = login.getText().toString();
				String s = senha.getText().toString();
				
				if(l.equals("mardson") && s.equals("123")){
					 Intent intent = new Intent();
					 intent.setClass(LoginActivity.this, CategoriasActivity.class);
					 startActivity(intent);
				}
			}
		});
		
	}
	
	/*
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {

		menu.add(0, 1, 0, "Salvar");
		menu.add(0, 2, 1, "Cancelar");
		return true;
	}// fim do m�todo

	@Override
	public boolean onOptionsItemSelected(MenuItem it) {
		switch (it.getItemId()) {
		case 1:
			break;
		case 2:
			break;
		default:
			break;
		}
		return super.onOptionsItemSelected(it);
	}
*/
}
